package main

import (
	"fmt"
	"io"
	"os"
)

func main() {
	path := "./03_file_read.txt"
	readFile(path)
}

func readFile(path string) {
	file, err := os.Open(path)
	if err != nil {
		fmt.Println(" readFile-err : ", err)
	}

	defer file.Close()

	buffer := make([]byte, 1024*2)
	fn, ferr := file.Read(buffer)
	if ferr != nil && ferr != io.EOF {
		fmt.Println(" read-err : ", ferr)
		return
	}

	fmt.Println(" buffer = \n ", string(buffer[:fn]))

}
